package cn.ito.zjgsu.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.ito.zjgsu.domain.Role;
import cn.ito.zjgsu.domain.RoleExample;
import cn.ito.zjgsu.mapping.RoleMapper;
import cn.ito.zjgsu.service.RoleService;
@Service
@Transactional
public class RoleServiceImpl implements RoleService{

	@Resource
	private RoleMapper roleMapper;
	
	@Override
	public Role findRoleByExample(RoleExample roleExample) {
		List<Role> roles = roleMapper.selectByExample(roleExample);
		if(null != roles && !roles.isEmpty()){
			return roles.get(0);
		}
		return null;
	}

}
